//
//  HMStatusModel.swift
//  WeiBoXR
//
//  Created by acer on 16/9/24.
//  Copyright © 2016年 acer. All rights reserved.
//

import UIKit

class HMStatusModel: NSObject {
    //  发微博时间
    var created_at: String?
    //  微博id
    var id: Int64 = 0
    //  微博内容
    var text: String?
    //  微博来源
    var source: String?
    //  用户模型
    var user: HMUserModel?
    
    //  转发数
    var reposts_count: Int = 0
    //  评论数
    var comments_count: Int = 0
    //  赞
    var attitudes_count: Int = 0

    //  转发微博内容
    var retweetContent: String?
    //  转发微博
    var retweeted_status: HMStatusModel?
    //  微博配图模型数组
    var pic_urls: [HMStatusPictureInfo]?
    
    //  swift 写法, 指定集合属性元素类型
    class func modelContainerPropertyGenericClass() -> [String: Any] {
        
        return [
            "pic_urls": HMStatusPictureInfo.self
        ]
        
    }

/*
    init(dic: [String: Any]) {
        super.init()
        setValuesForKeys(dic)
    }
    override func setValue(_ value: Any?, forKey key: String) {
        if key == "user" {
            guard let dic = value as? [String: Any] else {
                print("有错误")
                return
            }
            user = HMUserModel(dic: dic)
        } else {
            super.setValue(value, forKey: key)
        }
    }
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
    }
 */
}
